import { defHttp } from "@/utils/http";
// ERP 单据申请 VO
export interface DocAppVO {
	id: number; // 主键ID,示例值(12909)
	receiptYear: string; // 年
	parentId: number; // 父级ID,示例值(24590)
	deptId: string; // 部门代码,示例值(30202)
	type: number; // 类型,示例值(1)
	receiptNo: number; // 单据编号
	printType: number; // 打印类型,示例值(2)
	whsId: string; // 仓库代码,示例值(27279)
	bizId: string; // 业务id,示例值(2869)
	qty: number; // 数量
	printCount: number; // 打印次数,示例值(2652)
	fundingId: string; // 来源id,示例值(31806)
	recipientId: string; // 收件人,示例值(14151)
}

// ERP 单据申请 API
export const DocAppApi = {
	// 查询单据申请分页
	getDocAppPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/receipt-apply/page`, params });
	},

	// 查询单据申请详情
	getDocApp: async (id: number) => {
		return await defHttp.get({ url: `/whs/receipt-apply/get?id=` + id });
	},

	// 新增单据申请
	createDocApp: async (data: DocAppVO) => {
		return await defHttp.post({ url: `/whs/receipt-apply/create`, data });
	},

	// 修改单据申请
	updateDocApp: async (data: DocAppVO) => {
		return await defHttp.put({ url: `/whs/receipt-apply/update`, data });
	},

	// 删除单据申请
	deleteDocApp: async (id: number) => {
		return await defHttp.delete({ url: `/whs/receipt-apply/delete?id=` + id });
	},

	// 导出单据申请 Excel
	exportDocApp: async (params: any) => {
		return await defHttp.download({ url: `/whs/receipt-apply/export-excel`, params });
	}
};
